using System;
using UnityEngine;

[DisallowMultipleComponent]
public class HMI_ComponentBase : MonoBehaviour
{
    public string widgetType = "";
    public bool RTLDontChange; //RTL模式下布局不改变
    public string VoiceText;
    public string VoiceTitle;

    public void SetVoiceText(string text)
    {
        text = text.TrimEnd('|');
        text = text.ToUpper();
        VoiceText = text;
    }

    public virtual bool ExportToProgram()
    {
        return true;
    }

    public HMI_ComponentBaseData GetDataBase()
    {
        HMI_ComponentBaseData data = new HMI_ComponentBaseData();
        data.widgetType = widgetType;
        data.RTLDontChange = RTLDontChange;

        return data;
    }

    public void SetDataBase(HMI_ComponentBaseData data)
    {
        RTLDontChange = data.RTLDontChange;
    }
}

[Serializable]
public class HMI_ComponentBaseData
{
    public string widgetType;
    public bool RTLDontChange;
}

